package com.example.myapplication.retrofit;
import com.example.myapplication.base.BaseApplication;

import java.io.IOException;
import java.util.HashSet;

import okhttp3.Interceptor;
import okhttp3.Request;

public class AddCookiesInterceptor implements Interceptor {

    @Override
    public okhttp3.Response intercept(Chain chain) throws IOException {
        Request.Builder builder = chain.request().newBuilder();
//        HashSet<String> preferences = (HashSet)
//                BaseApplication.getInstance().getSharedPreferences("config", BaseApplication.getInstance().MODE_PRIVATE).getStringSet("cookie", null);
//        if (preferences != null) {
//            for (String cookie : preferences) {
//                builder.addHeader("Cookie", cookie);
//            }
//        }
        return chain.proceed(builder.build());
    }
}


